<template>
  <div class="navbar">
    <el-menu
      :router="true"
      :default-active="path"
      class="el-menu-vertical-demo"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
    >
      <el-menu-item :index="item.path" v-for="item in menuList" :key="item.path">
        <i :class="item.icon"></i>
        <span slot="title">{{ item.title }}</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
    data() {
        return {
          path:"",
            menuList:[
                {
                    path:"/home/users",
                    icon:"el-icon-user-solid",
                    title:"用户管理"
                },
                {
                    path:"/home/goods",
                    icon:"el-icon-bank-card",
                    title:"商品管理"
                },
                {
                    path:"/home/orders",
                    icon:"el-icon-s-order",
                    title:"订单管理"
                }
            ]
        }
    },
    components:{},
    methods: {

    },
    created(){
      this.path=this.$route.path
      console.log(this.path)

    }
}
</script>

<style>

</style>